﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NHibernateTest.AutoMapping
{
    using System.Diagnostics;
    using Entitys;
    using FluentNHibernate.Automapping;
    using FluentNHibernate.Automapping.Alterations;

    public class CourseMapping : IAutoMappingOverride<Course>
    {
        public void Override(AutoMapping<Course> mapping)
        {
            //mapping.HasManyToMany(cr => cr.Students).Inverse();
            Debug.WriteLine("Inverse   Course");
        }
    }
    public class StudentMapping : IAutoMappingOverride<Student>
    {
        public void Override(AutoMapping<Student> mapping)
        {
            mapping.HasManyToMany(cr => cr.Courses).Not.Inverse();
            Debug.WriteLine("Inverse   Student");
        }
    }
    public class TeacherMapping : IAutoMappingOverride<Teacher>
    {
        public void Override(AutoMapping<Teacher> mapping)
        {
            mapping.HasOne(x => x.ManageClass);
        }
    }
    public class ClassMapping : IAutoMappingOverride<Class>
    {
        public void Override(AutoMapping<Class> mapping)
        {
            mapping.HasOne(x => x.Adviser);
        }
    }
}
